package com.onlyphoto.onlymall.mvp.presenter

import android.content.Context
import com.onlyphoto.onlymall.base.BaseNetworkResponse
import com.onlyphoto.onlymall.base.BaseObserver

import com.onlyphoto.onlymall.mvp.contract.CRaiders
import com.onlyphoto.onlymall.mvp.model.MRaidersImpl
import com.onlyphoto.onlymall.base.BasePresenter
import com.onlyphoto.onlymall.bean.response.ArticleBean


class PRaidersImpl(mContext: Context, mView: CRaiders.IVRaiders) : BasePresenter<CRaiders.IVRaiders, MRaidersImpl>(mContext, mView, MRaidersImpl()), CRaiders.IPRaiders {
    override fun getRaiders(getType: Int, articleType: Int) {
        mModel.getRaiders(getType, articleType, object : BaseObserver<ArrayList<ArticleBean>>(mContext.get()){
            override fun onSuccess(data: ArrayList<ArticleBean>?, msg: String?) {
                mView.getRaidersSuccess(data!!)
            }

            override fun onCodeError(t: BaseNetworkResponse<ArrayList<ArticleBean>>?) {
            }

            override fun onFailure(e: Throwable?) {
            }

            override fun onRequestStart() {
            }

            override fun onFinally() {
            }
        })
    }
}
